<template>
	<view>
		<navigator url=""></navigator>
		<view class="uni-form-item uni-column">
					<input style="margin: 0 40rpx;" class="uni-input" focus placeholder="请输入标题" />
				<hr style="margin: 20rpx 40rpx;">
				</view>
				<textarea style="margin: 20rpx 40rpx;" name="" id="" cols="50" rows="20" placeholder="请输入作品描述" ></textarea>
				<view class="box">
					点击添加图片说明
				</view>
				<button class="filebox" @click="file"><img src="../../images/2.png" alt=""></button>
	</view>
</template>

<script>
	export default {
		components:{
		
		},
		data() {
			return {
				
			}
		},
		methods: {
			// 选择图片文件
		file(){
		uni.chooseImage({
			success: (chooseImageRes) => {
				const tempFilePaths = chooseImageRes.tempFilePaths;
				uni.uploadFile({
					url: 'https://localhost/upload', //仅为示例，非真实的接口地址
					filePath: tempFilePaths[0],
					name: 'file',
					// formData: {
					// 	'user': 'test'
					// },
					success: (uploadFileRes) => {
						console.log(uploadFileRes.data);
					}
				});
			}
		});
		}
			}
	}
</script>

<style lang="scss">
uni-form-item uni-column{
	color: #999999;
}
.box{
	width: 750rpx;
	height: 80rpx;
	background-color: #e9e9e9;
	line-height: 80rpx;
	display: flex;
	justify-content: start;
	padding: 0 40rpx;
	font-size: 24rpx;
	color: #999999;
}
.filebox{
	width: 200rpx;
	height: 200rpx;
	border: 2px solid #999999;
	display: flex;
	justify-content: center;
	align-items: center;
}
</style>
